<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <style>
        body{
            position: relative;
        }
        .login_title{
            text-align: center;
            font-size: 24px;
        }
        #login p{
            width: 300px;
            height: 40px;
            margin: 20px auto;
        }
        #login p label {
            display: inline-block;
            height: 40px;
            width: 60px;
            text-align: justify;
            line-height:40px;
        }
        #login p input {
            display: inline-block;
            height: 40px;
            line-height: 40px;
            width: 240px;
            outline:none;
        }
        .modal-content{
            width: 450px;
            margin: 0 auto;
            position: absolute;
            top:50%;
            left:50%;
            margin:-151px 0 0 -225px;
            display: block;
        }
    </style>
</head>
<body>
<button class="btn btn-primary" type="button">点击</button>
<div class="modal" id="mymodal">
    <!--<div class="modal-dialog">-->
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span aria-hidden="true">close</span>
                    <!--<span class="sr-only">close</span>-->
                </button>
                <h4 class="modal-title login_title">登录界面</h4>
            </div>
            <div class="modal-body">
                <form action="#" id="login">
                    <p><label>用户名:</label><input type="text" placeholder="用户名"></p>
                    <p><label>密&nbsp;&nbsp;&nbsp;码:</label><input type="password" placeholder="密码"></p>
                </form>

            </div>
            <div class="modal-footer">
                <button class="btn btn-default" type='submit' data-dismiss="modal">登录</button>
            </div>
        </div>
    </div>
<!--</div>-->

<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript">
    $(function(){
        $('.btn').click(function(){
            $('#mymodal').modal();
        })
    })
</script>
</body>
</html>